#include <iostream>

using namespace std;


int main()
{
    int a[100],b[100];
    float c[100];
    int n,m,i,j,k;
    std::cout<<"n=";
    std::cin>>n;
    for (i=0;i<n;i++)
    {
        std::cout<<"a["<<i<<"]=";
        std::cin>>a[i];
    }
     for (i=0;i<n;i++)
    {
        std::cout<<"b["<<i<<"]=";
        std::cin>>b[i];
    }
    for (i=0;i<n;i++)
    {
        if (a[i]*b[i]<0)
        {
            c[i]=(float)(a[i]+b[i])/2;
        }
        else
        {
            if (a[i]<b[i]) c[i]=b[i];
            else c[i]=a[i];
        }
    }
    for (i=0;i<n;i++)
    {
        std::cout<<c[i]<<" ";
    }
    return 0;
}
